﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using TicketsPhone.Domain.Entities;
using TicketsPhone.Domain.Access;
using System.Configuration;

namespace TicketsPhone.Web.WebService
{
    /// <summary>
    /// Summary description for EnvioAlertas
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class EnvioAlertas : System.Web.Services.WebService
    {

        [WebMethod]
        public Alerta[] ObtenerTurnosPendientesSMS()
        {
            AlertaRepositorio _alerta = new AlertaRepositorio();
            return _alerta.ObtenerAlertasPendientes(Convert.ToInt32(ConfigurationManager.AppSettings["topEnvioMensajes"])).ToArray();
        }

        [WebMethod]
        public void MarcarMensajeComoEnviado(int idAlerta)
        {
            AlertaRepositorio _alerta = new AlertaRepositorio();
            _alerta.MarcarComoEnviado(idAlerta);
        }
    }
}
